#!/usr/bin/env python

'''App string resource

@author Julot <andy.julot@gmail.com>
@since Saturday, March 24, 2012. 05:25 PM


Changes Log:

1.0.0.3
+ Multi upload.
+ Tiff image is now supported.

1.0.0.2
+ Create cache for uploaded image in folder document.

1.0.0.1
! Auto fit image preview and open in default program on click.

1.0.0.0
+ Create document.'''

def _humanizeVersion(version):
    versions = version.split('.')
    stages = ('Alpha', 'Beta', 'Release Candidate', 'Public Release')
    if int(versions[2]) == 3:
        if int(versions[3]) == 0:
            r = '%s.%s' % (versions[0], versions[1])
        else:
            r = '%s.%s Revision %s' % (versions[0], versions[1], versions[3])
    else:
        if int(versions[3]) == 0:
            r = '%s.%s %s' % (versions[0], versions[1],
                              stages[int(versions[2])])
        else:
            r = '%s.%s %s %s' % (versions[0], versions[1],
                                 stages[int(versions[2])], versions[3])
    return r

def _humanizeDate(date):
    try:
        import dateutil.parser
        return dateutil.parser.parse(date)
    except:
        import datetime
        return datetime.datetime.now()
    
name = 'Aoi'
version = '1.0.0.3'
description = 'Document Scanner'
longDescription = 'Document Scanner'
trademarks = 'As I pray, unlimited syntax works'
copyright = 'Copyright 2012 Julot'
company = 'Seraphim'
author = 'Julot'
authorEmail = 'andy.julot@gmail.com'
blessing = 'May you do good and not evil.\r\n' \
         + 'May you find forgiveness for yourself and forgive others.\r\n' \
         + 'May you share freely, never taking more than you give.'
humanVersion = _humanizeVersion(version)

histories = {'0.0.0.0': '2012-04-12', '1.0.0.0': '2012-04-13',
             '1.0.0.1': '2012-04-14', '1.0.0.2': '2012-04-18',
             version: '2012-04-21'}

releaseDate = _humanizeDate(histories[version])

manifest = '''
    <assembly
      xmlns="urn:schemas-microsoft-com:asm.v1"
      manifestVersion="1.0"
    >
      <assemblyIdentity
        version="%s"
        processorArchitecture="x86"
        name="%s"
        type="win32"
      />
      <description>%s</description>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel
              level="asInvoker"
              uiAccess="false"
            />
          </requestedPrivileges>
        </security>
      </trustInfo>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity
            type="win32"
            name="Microsoft.VC90.CRT"
            version="9.0.21022.8"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b"
          />
        </dependentAssembly>
      </dependency>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
          />
        </dependentAssembly>
      </dependency>
    </assembly>
    ''' % (version, name, name)
